package com.wyclabs.auth.common.exception;


import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import lombok.Getter;
import lombok.Setter;
import org.springframework.security.oauth2.common.exceptions.OAuth2Exception;

/**
 * 自定义 oauth 2.0 异常处理
 * @author rs
 * @date 2019/10/17
 */
@JsonSerialize(using = CustomOauth2ExceptionSerializer.class)
public class CustomOauth2Exception extends OAuth2Exception {

    /**
     * 错误码
     */
    @Getter
    @Setter
    private String errorCode;

    public CustomOauth2Exception(String errorCode, String msg) {
        super(msg);
        this.errorCode = errorCode;
    }

    public CustomOauth2Exception(String errorCode, String msg, Throwable t) {
        super(msg, t);
        this.errorCode = errorCode;
    }
}
